﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="FileEditor.aspx.cs" Inherits="ZX.WebApp.ExtendPage.CtrlPage.FileEditor" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<style type="text/css">
    body
    {
        background-color:#fff;
        padding:0px;
        margin:0px;
    }
    input,textarea
    {
       width:100%;
    }
    
    
</style>
</head>
<body>
    <form id="form1" action="/Extend/AjaxData/DataSave.aspx?action=createFile&entity=hrEmployee">

                <div class="control-group normal_text">
                    <h3>
                    </h3>
                </div>
                <div class="control-group">
                    <div class="controls">
                        <div class="main_input_box">
                            <span class="add-on bg_lg"><i class="icon-user">文件夹:</i></span>
                             <input id="FilePath" placeholder="文件路径" type="text"  value="<%=FilePath %>" name="FilePath"/>
                        </div>
                    </div>
                </div>
                <div class="control-group">
                    <div class="controls">
                        <div class="main_input_box">
                            <span class="add-on bg_ly"><i class="icon-lock">文件名:</i></span>
                           <input id="FileName" placeholder="文件名" type="text" value="<%=FileName %>" name="FileName" />
                        </div>
                    </div>
                </div>
                <div class="control-group">
                    <div class="controls">
                        <div class="main_input_box">
                            <span class="add-on bg_lg"><i class="icon-user">文件内容:</i></span>
                              <textarea id="FileContent" placeholder="文件内容" cols="20" rows="2" name="FileContent"><%=FileContent%></textarea>
                        </div>
                    </div>
                </div>
    </form>
</body>
<script src="/Scripts/jquery-1.6.min.js" type="text/javascript"></script>
<script type="text/javascript" src="/Scripts/yui_2.9.0/build/yahoo-dom-event/yahoo-dom-event.js"></script>
<script type="text/javascript" src="/Scripts/yui_2.9.0/build/json/json-min.js"></script>
<script type="text/javascript" src="/Scripts/yui_2.9.0/build/connection/connection-min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#FileContent").height($(window).height()-140);
});


var Save = function () {
    PostFile();
}

function PostFile() {
    var formObject = document.getElementById('form1');
    YAHOO.util.Connect.setForm(formObject);
    var cObj = YAHOO.util.Connect.asyncRequest('POST', "/Extend/AjaxData/DataSave.aspx?action=createFile&entity=hrEmployee&r=" + Math.random(), callback);
    return false;
}
var responseSuccess = function (res) {
    //alert(res.responseText);   
    //debugger
    try {

        var str = res.responseText;
        alert(str);
    }
    catch (e) {
        alert(e);
    }
    finally {
    }
};
var responseFailure = function (error) {
    //debugger
    alert("保存文件失败!");
}

var callback = {
    success: responseSuccess,
    failure: responseFailure
};
</script>
</html>
